import Vue from 'vue'
import Router from 'vue-router'
import home from './pages/home/index'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('./pages/login/index.vue')
    },
    {
      path: '/',
      redirect: 'admin',
      component: home,
      children: [
        {
          path: 'admin',
          component: () => import('./pages/admin/index.vue'),
          name: 'admin'
        }
      ]
    },
    {
      path: '/home',
      redirect: '/home/index'
    },
    {
      path: '/project',
      component: home,
      children: [
        {
          path: 'index',
          component: () => import('./pages/project/index.vue'),
          name: 'project'
        }
      ]
    },
    {
      path: '/teachers',
      component: home,
      children: [
        {
          path: 'index',
          component: () => import('./pages/teachers/index'),
          name: 'teachers'
        }
      ]
    },
  ]
})
